package com.bw.house.viewmodel

import androidx.lifecycle.MutableLiveData
import com.bw.common.vm.BaseViewModel
import com.bw.house.result.HouseResult
import com.bw.house.service.ApiService
import com.bw.http.utils.zgr.OkHttpClientManager

class HouseViewModel:BaseViewModel() {

    val apiService by lazy { OkHttpClientManager.retrofitInstance.create(ApiService::class.java) }

    val houseSuccess  by lazy { MutableLiveData<List<HouseResult>>() }


    fun getHouse(){
       executeNetwork(
           {
               apiService.house()
           },
           houseSuccess::postValue
       )
    }
}